# Maintainer: 
# Contributor Sarah Hay <sarahhay@mb.sympatico.ca>

pkgname=libcdaudio
_pkgver=0.99.12p2
pkgver=0.99.12.p2
pkgrel=3
pkgdesc="Library for controlling Audio CDs and interacting with CDDB"
arch=('x86_64')
url="http://libcdaudio.sourceforge.net/"
license=('GPL')
depends=('glibc')
source=("https://downloads.sourceforge.net/sourceforge/libcdaudio/${pkgname}-${_pkgver}.tar.gz"
        '01-cddb-bufferoverflow.patch'
        '02-cddb-bufferoverflow.patch')
sha256sums=('5fdaf9af5ac4f75c0215d000b82b128fd054a582f81cc4f039a1e7fe69335ebb'
            '2eb622aeabcaeb1e3cdae5a5f6015cf16c1cd4e1ea38344da00905923d34a60f'
            '3a91822b22bdf8a87df5a17b5ef5e134140ea2147792cae37be97f09c812062a')

build() {
  cd ${pkgname}-${_pkgver}
  patch -Np1 -i "${srcdir}/01-cddb-bufferoverflow.patch"
  patch -Np1 -i "${srcdir}/02-cddb-bufferoverflow.patch"
  ./configure --prefix=/usr
  make
}

package() {
  cd ${pkgname}-${_pkgver}
  make DESTDIR="${pkgdir}" install
}
